using System.Collections.Generic;

namespace InnerFireEditor {
  public class FileManagerItem {
    public string Name { get; set; }
    public string FullPath { get; set; }
    public bool IsDirectory { get; set; }
    public List<FileManagerItem> Children { get; set; } = new List<FileManagerItem>();

    // 可选：添加其他文件属性
    public long Size { get; set; }
    public string Extension { get; set; }
    public System.DateTime LastModified { get; set; }

    public FileManagerItem(string name, string fullPath, bool isDirectory) {
      Name = name;
      FullPath = fullPath;
      IsDirectory = isDirectory;

      if (!isDirectory) {
        var fileInfo = new System.IO.FileInfo(fullPath);
        Size = fileInfo.Length;
        Extension = fileInfo.Extension;
        LastModified = fileInfo.LastWriteTime;
      } else {
        var dirInfo = new System.IO.DirectoryInfo(fullPath);
        LastModified = dirInfo.LastWriteTime;
      }
    }
  }
}